package net.hn.hnms.biz.common.activiti.params;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created on 2022/8/1.
 *
 * @author ly
 * @desc: 动态流程步骤创建参数
 */
@Data
@ApiModel("动态流程节点创建参数")
public class ProcessNodeParam implements Serializable {

    @ApiModelProperty("该步骤可审核的角色合集")
    private List<String> roles = new ArrayList<>();

    @ApiModelProperty("该步骤可审核的人员合集")
    private List<String> users = new ArrayList<>();

    @ApiModelProperty("节点名称")
    @NotBlank(message = "节点名称不能为空")
    private String nodeName;

    @ApiModelProperty("回退节点")
    private String rollBackNode;

    public void addUser(String user) {
        this.users.add(user);
    }

    public void addUsers(List<String> users) {
        this.users.addAll(users);
    }

    public void addRole(String role) {
        this.roles.add(role);
    }

    public void addRoles(List<String> roles) {
        this.roles.addAll(roles);
    }

}
